<?php

class Xzsdsplus_Costpriceplus_Block_Banner extends Mage_Adminhtml_Block_Widget_Container {

    public function __construct() {
        parent::__construct();
        $this->setTemplate('costpriceplus/list.phtml');
    }

    protected function _prepareLayout() {
        $this->_addButton('add_new', array(
            'label'   => Mage::helper('catalog')->__('Add Banner'),
            'onclick' => "setLocation('{$this->getUrl('*/*/new')}')",
            'class'   => 'add'
        ));

        $this->setChild('grid', $this->getLayout()->createBlock('costpriceplus/grid', 'product.grid'));
        return parent::_prepareLayout();
    }

    public function getAddNewButtonHtml() {
        return $this->getChildHtml('add_new_button');
    }

    public function getGridHtml() {
        return $this->getChildHtml('grid');
    }

    public function isSingleStoreMode() {
        if (!Mage::app()->isSingleStoreMode()) {
               return false;
        }
        return true;
    }
}
